DELETE
/
ai
/
{projectId}
/
agent
/
history
/
{threadId}
curl --request DELETE \
  --url https://partner.peaka.studio/api/v1/ai/{projectId}/agent/history/{threadId}
{
  "history": [
    {
      "id": "def9ccc7-a791-42f9-b40f-47679cde3b12",
      "aiThreadId": "2183372c-7b72-479a-9eec-dd29aafa255b",
      "displayName": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
      "tasks": [
        {
          "step": [
            {
              "action": {
                "log": "The first example is very similar to the current question. I will use the SQL query from that example and modify it to fit the current question, ensuring it retrieves the top 3 portfolios ranked by their total market value as of the most recent date recorded.\n\nAction: table-name-semantic-search-tool\nAction Input: portfolios, market value, date",
                "tool": "table-name-semantic-search-tool",
                "toolInput": "portfolios, market value, date"
              },
              "observation": "supabase.public.portfolios,supabase.public.holdings,supabase.public.currencies,supabase.public.assets,supabase.public.assetclasses,supabase.public.assettypes,supabase.public.exchanges,supabase.public.transactiontypes,supabase.public.transactions,supabase.realtime.schema_migrations"
            }
          ],
          "output": {
            "data": [
              [
                {
                  "name": "portfolio_name",
                  "order": 0,
                  "value": "102296_9",
                  "dataType": "varchar"
                },
                {
                  "name": "total_market_value",
                  "order": 1,
                  "value": 1887237400,
                  "dataType": "real"
                }
              ]
            ],
            "text": "The top 3 portfolios ranked by their total market value as of the most recent date recorded are: Portfolio '102296_9' with a total market value of 1,887,237,400, Portfolio '103100_7' with a total market value of 6,269,447.5, and Portfolio '103271_3' with a total market value of 2,563,462.8.",
            "query": "WITH LatestDate AS ( SELECT MAX(\"date\") AS \"latest_date\" FROM \"supabase\".\"public\".\"holdings\" ) SELECT h.\"portfolio_name\", SUM(h.\"ending_market_value\") AS \"total_market_value\" FROM \"supabase\".\"public\".\"holdings\" h JOIN LatestDate ld ON h.\"date\" = ld.\"latest_date\" GROUP BY h.\"portfolio_name\" ORDER BY \"total_market_value\" DESC LIMIT 5"
          },
          "message": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
          "modelParams": {
            "modelName": "gpt-4o",
            "temperature": 0
          }
        }
      ],
      "source": "API_KEY"
    }
  ]
}

Path Parameters

projectId
string
required
threadId
string
required

Response

200 - application/json
Delete AI Chat History

Represents the response containing AI chat history.

history
object[]

The list of AI chat history records.